package cn.edu.cqu.domains;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.Type;

/***********************************************************************
 * Module:  StudyNews.java
 * Author:  Guo
 * Purpose: Defines the Class StudyNews
 ***********************************************************************/

@Entity
@Table(name="StudyNews")
@DynamicUpdate
@DynamicInsert
public class StudyNews  implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Id
	private String sNewsID;
	private Date sNewsDate;
	private String sNewsURL;
	private String sNewsImgURL;
	@Type(type="text") 
	private String sNewsContent;
	private int sNewsType;
	private String sNewsTitle;
	
	public Admin admin;

	public int getsNewsType() {
		return sNewsType;
	}

	public void setsNewsType(int sNewsType) {
		this.sNewsType = sNewsType;
	}

	public String getsNewsTitle() {
		return sNewsTitle;
	}

	public void setsNewsTitle(String sNewsTitle) {
		this.sNewsTitle = sNewsTitle;
	}

	public String getsNewsID() {
		return sNewsID;
	}

	public void setsNewsID(String sNewsID) {
		this.sNewsID = sNewsID;
	}

	public java.util.Date getsNewsDate() {
		return sNewsDate;
	}

	public void setsNewsDate(java.util.Date sNewsDate) {
		this.sNewsDate = sNewsDate;
	}

	public java.lang.String getsNewsURL() {
		return sNewsURL;
	}

	public void setsNewsURL(java.lang.String sNewsURL) {
		this.sNewsURL = sNewsURL;
	}

	public java.lang.String getsNewsImgURL() {
		return sNewsImgURL;
	}

	public void setsNewsImgURL(java.lang.String sNewsImgURL) {
		this.sNewsImgURL = sNewsImgURL;
	}

	public java.lang.String getsNewsContent() {
		return sNewsContent;
	}

	public void setsNewsContent(java.lang.String sNewsContent) {
		this.sNewsContent = sNewsContent;
	}

	@ManyToOne(cascade=CascadeType.ALL,fetch=FetchType.LAZY,optional=true)
	@JoinColumn(name="aid",nullable=true)
	public Admin getAdmin() {
		return admin;
	}

	public void setAdmin(Admin admin) {
		this.admin = admin;
	}

	
}